

#define IIC_COMPLETE	0XA1
#define IIC_NO_ACK		0XA2
#define IIC_ERROR		0XA3

#define SDA	PA13
#define SCK	PA12


void i2c_init(void);
uint8_t i2c_write(uint8_t slave_address, uint8_t *buffer, int byte_count);
uint8_t i2c_read(uint8_t slave_address, uint16_t r_addr,uint8_t *buffer, int byte_count);
void i2c_start(void);
uint8_t i2c_stop(void);
void delay(int value);
void LVDS_i2c_start(uint8_t ch);
uint8_t LVDS_i2c_stop(uint8_t ch);
void LVDS_i2c_init(void);
uint8_t LVDS_i2c_write(uint8_t ch,uint8_t slave_address, uint8_t *buffer, int byte_count);
uint8_t LVDS_i2c_read(uint8_t ch,uint8_t slave_address, uint8_t *buffer, int byte_count);
void write_reg_32(uint8_t slaveaddress,uint16_t address,uint32_t data);
void LVDS_write_reg_32(uint8_t ch,uint8_t slaveaddress,uint16_t address,uint32_t data);
void write_reg_16(uint8_t slaveaddress,uint8_t address,uint16_t data);
void write_reg_8(uint8_t slaveaddress,uint8_t address,uint8_t data);
uint16_t read_reg_16(uint8_t slaveaddress,uint8_t address);







